package io.renren.modules.generator.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import io.renren.modules.generator.entity.TTrainingObjectEntity;
import io.renren.modules.generator.entity.TTrainingScoreEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.generator.entity.vo.TTrainingScoreVo;
import io.renren.modules.generator.entity.vo.UpdateScoreVo;
import io.renren.modules.user.entity.TPeopleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 考核成绩表
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2019-08-07 13:58:41
 */
@Mapper
public interface TTrainingScoreDao extends BaseMapper<TTrainingScoreEntity> {

/**
 * 历史成绩列表
 */
List<TTrainingScoreEntity> getTTrainingScore(TTrainingScoreEntity trainingScoreEntity);
/**
 * 最新成绩列表
 */
List<TTrainingScoreEntity> selectList(TTrainingScoreEntity queryWrapper);
/**
 * 导入
 */
Boolean DrTTrainingScore(List<TTrainingScoreVo> list);
/**
 * 根据身份证号  获取人员id
 */
    TPeopleEntity getPeopleId(TPeopleEntity peopleEntity);
    /**
     * 自动评分 测试
     */
    List<TTrainingScoreEntity> automaticScoring(TTrainingScoreEntity trainingScoreEntity);
    /**
     * 批量修改  自动评分后 将成绩填入对应的行（人）
     */
    int updatePlScore(List<UpdateScoreVo> UpdateScoreList);

    int updateMarkAndjudge(List<TTrainingScoreEntity> list);

    int updateMarkAndjudgeSingle(TTrainingScoreEntity trainingScoreEntity);
    /**
     * 获取自动评分后 的合格率
     */
    Double getHgl(TTrainingScoreEntity trainingScoreEntity);
    /**
     * 判定 类型
     */
    List<Map<String,Object>> decideList();

    /**
     * 获取单次训练成绩
     */
    List<TTrainingScoreEntity> selectByTrainingIdAndChenkCount(@Param("trainingId") Integer trainingId, @Param("chenkCount")Integer chenkCount);
    /**
     * 批量获取人员ID
     */
    List<Map<String,Object>> batchGetPeopleId(@Param("list") List<String> list);

    /**
     * 获取人员ID
     */
    Map<String,Object> selectPeople(@Param("id") Integer id);
}
